#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Project: spd-sxmcc
"""
@author: lyndon
@time Created on 2019/2/20 16:47
@desc
"""

from impala.error import HiveServer2Error
from impala.dbapi import connect
#获取Connect对象
conn = connect(host='10.231.32.131',port=10000,database='sjtd',auth_mechanism='GSSAPI',kerberos_service_name='hive')
print(conn)

cursor = conn.cursor()
ret = False
try:
    cursor.execute('desc fangtianxia_test_1')
    print (cursor.description)  # prints the result set's schema
    results = cursor.fetchall()
    print(results)
    ret = True
except HiveServer2Error as e:
    pass

print('------------')
print(ret)

